# 软链接源文件一定是绝对路径
cutconfig="$HOME/mydotfiles/archlinux/config"
systemconfig="$HOME/.config"
archlinuxconfig="$cutconfig/archconfig"
langconfig="$cutconfig/langconfig"
wmconfig="$cutconfig/wmconfig"
echo "cutconfig: $cutconfig"
echo "systemconfig: $systemconfig"
echo "ArchLinu基本配置: $archlinuxconfig"
echo "语言基本配置: $langconfig"
echo "动态窗口管理配置: $wmconfig"

# ln -sf  $cutconfig/dwm/xinitrc $systemconfig/.xinitrc"

echo "[====ArchLinu基本配置====]"

# ArchLinu基本配置

#locale
sudo ln -sf $archlinuxconfig/locale/locale.gen /etc/locale.gen
sudo ln -sf $archlinuxconfig/locale/locale.conf /etc/locale.conf

#pacman
# sudo ln -sf $archlinuxconfig/pacman/mirrorlist /etc/pacman.d/mirrorlist

sudo ln -sf $archlinuxconfig/pacman/pacman.conf /etc/pacman.conf

#gitconfig
ln -sf $archlinuxconfig/gitconfig/gitconfig $HOME/.gitconfig

#fish
rm -rf $systemconfig/fish
ln -sf $archlinuxconfig/fish/ $systemconfig/

#nushell
# ln -sf $archlinuxconfig/nushell/ $systemconfig/

#starship
ln -sf $archlinuxconfig/starship/starship.toml $systemconfig/starship.toml

# #gitconfig
#  ln -sf  $archlinuxconfig/gitconfig/gitconfig $systemconfig/.gitconfig

# k9s
ln -sf $archlinuxconfig/k9s/ $systemconfig/

#screenkey
ln -sf $archlinuxconfig/screenkey/screenkey.json $systemconfig/screenkey.json

# #neofetch
# ln -sf $archlinuxconfig/neofetch/ $systemconfig/
# #fastfetch
ln -sf $archlinuxconfig/fastfetch/ $systemconfig/
#btop
ln -sf $archlinuxconfig/btop/ $systemconfig/

# fcitx5
ln -sf $archlinuxconfig/fcitx5/pam_environment $HOME/.pam_environment
ln -sf $archlinuxconfig/fcitx5/ $systemconfig/

#ladygit
ln -sf $archlinuxconfig/lazygit/config.yml $systemconfig/lazygit/config.yml

#microsoft-edge-dev-flags.conf
ln -sf $archlinuxconfig/flags/microsoft-edge-dev-flags.conf $systemconfig/microsoft-edge-dev-flags.conf
ln -sf $archlinuxconfig/flags/code-flags.conf $systemconfig/code-flags.conf

#gtk-3.0
ln -sf $archlinuxconfig/gtk-3.0/ $systemconfig/

#gtk-4.0
ln -sf $archlinuxconfig/gtk-4.0/ $systemconfig/

#sddm
# sudo mkdir /etc/sddm.conf.d
# sudo mkdir /usr/share/sddm/themes/sugar-candy
sudo ln -sf $archlinuxconfig/sddm/sddm.conf.d/ /etc/

#sudo ln -sf $archlinuxconfig/sddm/sugar-candy/ /usr/share/sddm/themes/
# sudo cp -r $archlinuxconfig/sddm/sugar-candy /usr/share/sddm/themes/

# wezterm
# ln -sf $archlinuxconfig/wezterm/ $systemconfig/

#ghostty
ln -sf $archlinuxconfig/ghostty/ $systemconfig/

#alacrittly
ln -sf $archlinuxconfig/alacritty/ $systemconfig/

# foot.ini
ln -sf $archlinuxconfig/foot/ $systemconfig/

#rio
ln -sf $archlinuxconfig/rio/ $systemconfig/

#sirula
ln -sf $archlinuxconfig/sirula/ $systemconfig/

#rofi
# ln -sf $archlinuxconfig/rofi/ $systemconfig/

#ironbar
ln -sf $archlinuxconfig/ironbar/ $systemconfig/

#waybar
# ln -sf $archlinuxconfig/waybar/ $systemconfig/

# HybridBar
# ln -sf $archlinuxconfig/HybridBar/ $systemconfig/

#eww
# ln -sf $archlinuxconfig/eww/ $systemconfig/

#wlogout
ln -sf $archlinuxconfig/wlogout/ $systemconfig/

#mako
ln -sf $archlinuxconfig/mako/ $systemconfig/

#swaylock
# ln -sf $archlinuxconfig/swaylock/ $systemconfig/

#cava
ln -sf $archlinuxconfig/cava/ $systemconfig/

#viewnior
ln -sf $archlinuxconfig/viewnior/ $systemconfig/

#wpaperd
ln -sf $archlinuxconfig/wpaperd/ $systemconfig/

#wlogout
ln -sf $archlinuxconfig/wlogout/ $systemconfig/

#picom
#  ln -sf  $archlinuxconfig/picom/ $systemconfig/

#ranger
ln -sf $archlinuxconfig/ranger/ $systemconfig/

# pgcli
ln -sf $archlinuxconfig/pgcli/ $systemconfig/

# mycli
ln -sf $archlinuxconfig/dbcli/myclirc $HOME/.myclirc

#  ln -sf  $langconfig/waybar $systemconfig/waybar
#  ln -sf  $langconfig/alacritty $systemconfig/alacritty

# lightdm 软链接有问题，直接拷贝
# sudo  ln -sf  $archlinuxconfig/environment/environment" /etc/environment
# ln -sf  $archlinuxconfig/lightdm/lightdm.conf" /etc/lightdm/lightdm.conf
# ln -sf  $archlinuxconfig/lightdm/lightdm-webkit2-greeter.conf" /etc/lightdm/lightdm-webkit2-greeter.conf

echo "[====语言基本配置====]"
# 语言基本配置

#bun
ln -sf $langconfig/bun/bunfig.toml $HOME/.bunfig.toml
ln -sf $langconfig/npm/npmrc $HOME/.pnpmrc

#volta node
# ln -sf $langconfig/volta/hooks.json $HOME/.volta/hooks.json
#npm
ln -sf $langconfig/npm/npmrc $HOME/.npmrc
ln -sf $langconfig/npm/npmrc $HOME/.pnpmrc
ln -sf $langconfig/npm/yarnrc $HOME/.yarnrc

#cargo
ln -sf $langconfig/cargo/config.toml $HOME/.cargo/config.toml

#python3
ln -sf $langconfig/pip/ $systemconfig/

#go
ln -sf $langconfig/go/env $systemconfig/go/env
# ln -sf $langconfig/go/ $systemconfig/

echo "[====动态窗口管理配置====]"

#mango
ln -sf $wmconfig/mango/ $systemconfig/

#hyprland
ln -sf $wmconfig/hypr/ $systemconfig/

#niri
ln -sf $wmconfig/niri/ $systemconfig/

#wayfire
ln -sf $wmconfig/wayfire/wayfire.ini $systemconfig/wayfire.ini
ln -sf $wmconfig/wayfire/wf-shell.ini $systemconfig/wf-shell.ini

#sway
#   ln -sf  $wmconfig/sway/ $systemconfig/

#  ln -sf  $wmconfig/nwg-bar/ $systemconfig/

# chsh -s /usr/bin/fish
chsh -s /usr/bin/fish
echo "shell is changce" | figlet | lolcat
